package io.adminboot.service.impl;

import io.adminboot.domain.vo.PageVO;
import io.adminboot.entity.SysLog;
import io.adminboot.repository.extend.SysLogExtMapper;
import io.adminboot.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("sysLogService")
public class SysLogServiceImpl implements SysLogService {
	
	@Autowired
	private SysLogExtMapper mapper;

    @Override
    public PageVO queryPage(Integer pageNum, Integer pageSize, Long createUserId) {
    	
    	List<SysLog> list = mapper.selectList((pageNum - 1) * pageSize, pageSize, createUserId);
		int totalCount = mapper.count(createUserId);
		PageVO page = new PageVO(list, totalCount, pageSize, pageNum);
        return page;
    }

	@Override
	public void insert(SysLog sysLog) {
		mapper.insert(sysLog);
	}
	
}
